home *** CD-ROM | disk | FTP | other *** search
- /* param none */
-
- /* display a mathematical function in 3d */
-
- options results
-
- address 'rexx_TVPaint'
-
-
- /* reset */
-
- tv_UpdateUndo
- tv_SetDrawMode Color
- tv_AliasOn
- tv_StencilOff
- tv_DensityOff
- tv_CycleOff
- tv_AeroSpline 10 245
- tv_AeroPower 10
- tv_DensitySpline 255 50
- tv_XMax
- tv_YMax
- tv_WrapX 0
- tv_WrapY 0
- tv_RangeV
-
- tv_Clear
-
- x=100
- offx=20
- offy=150
-
- dx=14
- dy=7
-
- lw=20
- lh=20
-
- /* generating table with a function */
-
-
- do j=1 to lh
- do i=1 to lw
-
- a.i.j =((i-(lw%2))*(i-(lw%2))+(j-(lh%2))*(j-(lh%2)))-200
-
- /* try also with other functions */
-
- /* a.i.j =(i-(lw%2))-((i-(lw%2))*(i-(lw%2)))+(j-(lh%2))-((j-(lh%2))*(j-(lh%2)))*/
-
- /* a.i.j =(i-(lw%2))*(i-(lw%2))-(j-(lh%2))*(j-(lh%2)) */
-
- /* a.i.j =i*j%2 */
-
-
- end
- end
-
- /* let's go drawing */
-
-
- do j=2 to lh
-
- offy=offy+dy
-
- do i=lw to 2 by -1
- z=i-1
- zz=j-1
- x=i*dx+offx+dx
-
- col=(a.i.j-a.i.zz)*4+(a.z.j-a.i.j)*4+128
- if col>255 then col=255
- if col<0 then col=0
- tv_SetAPen col col col 255
-
- tv_AreaInit
- tv_AreaMove x-dx-dx offy-a.z.zz-dy
- tv_AreaMove x-dx offy-a.i.zz-dy
- tv_AreaMove x offy-a.i.j
- tv_AreaMove x-dx offy-a.z.j
- tv_AreaDraw
-
- end
- offx=offx+dx
- end
-
- /* colorizing the screen */
-
- tv_SetDrawMode Colorize
- tv_SetAPen 128 0 255 255
-
- tv_GetWidth
- width=result
-
- tv_GetHeight
- height=result
-
- tv_RectFill 0 0 width-1 height-1
-
- tv_SetDrawMode Color
-
-